adTempus API
PreviousUpNext
IScheduler::Freeze Method

Suspends updates of objects from the server to allow for safe manipulation of objects.

C++
HRESULT Freeze([out,retval]ILock ** lock);
C#
Freeze([out,retval]ILock * lock);
Visual Basic
Sub Freeze(lock As [out,retval]ILock *)

When auto-refresh is enabled, it is possible for an object to be refreshed while the client is manipulating it. To prevent this, the client should call Freeze to lock in the current state of the objects. 

Each call of Freeze returns a ILock object, which the caller must release to release its lock on the session. 

The session is not "unfrozen" until all ILock objects on the session have been released. 

Calling Freeze on IADTObject is equivalent to calling Freeze on the session to which the object belongs.

Use caution when using the Freeze method in .NET. After you have finished manipulating objects and are ready for refresh to resume, you must call System.Runtime.InteropServices.Marshal.ReleaseComObject on the ILock object to force the CLR to release the interface pointer. If you do not, the session will remain locked until the ILock object is garbage collected.

adTempus API Reference version 3.0.0.0, revised 10/30/2008